package com.itheima.mp.congfig;

import org.springframework.security.crypto.password.PasswordEncoder;

public class PlainTextPasswordEncoder implements PasswordEncoder {

    @Override
    public String encode(CharSequence rawPassword) {
        // 直接返回原始密码，不做加密处理
        return rawPassword.toString();
    }

    @Override
    public boolean matches(CharSequence rawPassword, String encodedPassword) {
        // 明文比对
        return rawPassword.toString().equals(encodedPassword);
    }
}
